<div class="manage">
    <div class="m-subheader">
      <div class="row align-items-center">
        <div class="mr-auto col-auto">
          <h3 class="m-subheader__title m-subheader__title--separator">
            <span>一体化文件导入</span>
          </h3>
        </div>
      </div>
    </div>
    <div class="m-content">
      <div class="m-portlet m-portlet--mobile">
        <div class="m-portlet__body">
            <div class="p-formgroup-inline">
                <div class="ui-grid-row" style="width: 50%;">
                    <div class="p-field title ui-grid-col-2">PPS系统文件信息</div>
                    <div class="input-lable ui-grid-col-1" style="margin-right: 20px;margin-left: 142px;margin-top:10px ;">文件编号：</div>
                    <div class="ui-grid-col-4" >
                        <input  type="text" placeholder="请输入文件编号" name="textCodeValue" size="30"
                        pInputText [(ngModel)]="textCodeValue" class="form-control" />
                    </div>
                    <div class="ui-grid-col-1" style="margin-top: 4px;">
                        <p-button *ngIf="'Pages.IntegrationDocument.Search' | permission" label="搜索" (onClick)="Search()" class="ml  ui-grid-col-3"></p-button>
                    </div>
                </div>
        </div>
        <hr style="border: 0.5px solid #888888;">
            <div class="p-formgroup-inline">
                <span class="p-field">
                    <span class="input-lable" style="margin-right: 20px;">文件编号：</span>
                    <p-dropdown name="textCodesValue" [options]="textCode" [(ngModel)]="textCodesValue" filter="true" placeholder="请选择文件"  emptyFilterMessage="暂无数据">
                        <ng-template let-item pTemplate="selectedItem">
                            <span *ngIf="textCodesValue != undefind "  style="vertical-align:middle; margin-left: .5em;width: 200px;">{{item.label}}</span>
                            <span *ngIf="textCodesValue == undefind " style="vertical-align:middle; margin-left: .5em;width: 200px;"> </span>
                        </ng-template>
                        <ng-template let-model pTemplate="item">
                            <div class="ui-helper-clearfix" style="position: relative;height: 25px;">
                                <div style="font-size:14px;float:right;margin-top:4px;width: 200px;">{{model.label}}</div>
                            </div>
                        </ng-template>
                    </p-dropdown>
                </span>
                <span class="p-field">
                    <span class="ml input-lable" style="margin-right: 20px;">型号：</span>
                    <p-dropdown name="modelValue" [options]="Models" [(ngModel)]="modelValue" filter="true" placeholder="请选择型号"  emptyFilterMessage="暂无数据">
                        <ng-template let-item pTemplate="selectedItem">
                            <span *ngIf="modelValue != undefind "  style="vertical-align:middle; margin-left: .5em;width: 200px;">{{item.label}}</span>
                            <span *ngIf="modelValue == undefind " style="vertical-align:middle; margin-left: .5em;width: 200px;"> </span>
                        </ng-template>
                        <ng-template let-model pTemplate="item">
                            <div class="ui-helper-clearfix" style="position: relative;height: 25px;">
                                <div style="font-size:14px;float:right;margin-top:4px;width: 200px;">{{model.label}}</div>
                            </div>
                        </ng-template>
                    </p-dropdown>
                </span>
                <span class="p-field">
                    <span class="ml input-lable" style="margin-right: 20px;">图号：</span>
                    <p-dropdown name="drawingNoValue" [options]="drawingNo" [(ngModel)]="drawingNoValue" filter="true" placeholder="请选择图号"  emptyFilterMessage="暂无数据">
                        <ng-template let-item pTemplate="selectedItem">
                            <span *ngIf="drawingNoValue != undefind "  style="vertical-align:middle; margin-left: .5em;width: 200px;">{{item.label}}</span>
                            <span *ngIf="drawingNoValue == undefind " style="vertical-align:middle; margin-left: .5em;width: 200px;"> </span>
                        </ng-template>
                        <ng-template let-model pTemplate="item">
                            <div class="ui-helper-clearfix" style="position: relative;height: 25px;">
                                <div style="font-size:14px;float:right;margin-top:4px;width: 200px;">{{model.label}}</div>
                            </div>
                        </ng-template>
                    </p-dropdown>
                </span>
                <p-button label="查询" (onClick)="getTableList()" class="ml"></p-button>
                <p-button label="重置" (onClick)="reset()" class="ml"></p-button>
            </div>
          <div class="row align-items-center" style="margin-top: 25px;">
            <div class="primeng-datatable-container">
              <p-table #dataTable [value]="primengTableHelper.records" (onLazyLoad)="getTableList($event)"
                rows="{{primengTableHelper.defaultRecordsCountPerPage}}" [paginator]="false" [lazy]="true"
                [scrollable]="true" ScrollWidth="100%" [responsive]="primengTableHelper.isResponsive"
                [resizableColumns]="primengTableHelper.resizableColumns">
                <ng-template pTemplate="header">
                  <tr>
                    <th style="width: 140px">操作</th>
                    <th style="width: 50px">序号</th>
                    <th style="width: 150px" pSortableColumn="techniqueNumber">
                        文件编号
                        <p-sortIcon field="techniqueNumber"></p-sortIcon>
                    </th>
                    <th style="width: 150px">名称</th>
                    <th style="width: 150px">版本</th>
                    <th style="width: 150px">子版本</th>
                    <th style="width: 150px">文件状态</th>
                    <th style="width: 150px"  pSortableColumn="productCode">
                        图号
                        <p-sortIcon field="productCode"></p-sortIcon>
                    </th>
                    <th style="width: 150px">型号</th>
                    <th style="width: 150px">发次</th>
                    <th style="width: 150px">阶段标记</th>
                    <th style="width: 150px">创建人</th>
                    <th style="width: 150px" pSortableColumn="creationTime">
                        创建日期
                        <p-sortIcon field="creationTime"></p-sortIcon>
                    </th>
                    <th style="width: 150px">属性</th>
                  </tr>
                </ng-template>
                <ng-template pTemplate="body" let-record="$implicit" let-rowIndex="rowIndex">
                  <tr>
                    <td style="width: 140px">
                      <div class="btn-group dropdown" dropdown container="body">
                        <button dropdownToggle class="dropdown-toggle btn btn-sm btn-primary">
                          <i class="fa fa-cog"></i><span class="caret"></span> 操作
                        </button>
                        <ul class="dropdown-menu" *dropdownMenu>
                            <li>
                                <a *ngIf="'Pages.IntegrationDocument.Details' | permission" href="javascript:;" (click)="look(record)">详情</a>
                              </li>
                          <li>
                            <a *ngIf="'Pages.IntegrationDocument.Delete' | permission" href="javascript:;" (click)="delete(record)">删除</a>
                          </li>
                          <li>
                            <a *ngIf="'Pages.IntegrationDocument.CopyProcedure' | permission" href="javascript:;" (click)="copy(record)">复制规程</a>
                          </li>
                          <!-- <li>
                            <div>
                                <span class="use" style="color:	#CC0000 ;">停用</span>
                                <p-inputSwitch #inputSwitch (onChange)="statusChange(record)" [(ngModel)]="use" class="use"></p-inputSwitch>
                                <span class="use" style="color: #00DD00;">启用</span>
                            </div>
                          </li> -->
                        </ul>
                      </div>
                    </td>
                    <td style="width: 50px">{{rowIndex+1}}</td>
                    <td style="width: 150px">{{record.techniqueNumber}}</td>
                    <td style="width: 150px">{{record.moduleName}}</td>
                    <td style="width: 150px">{{record.version}}</td>
                    <td style="width: 150px">{{record.edition}}</td>
                    <td style="width: 150px">{{record.fileStatusDesc}}</td>
                    <td style="width: 150px">{{record.moduleCode}}</td>
                    <td style="width: 150px">{{record.productCode}}</td>
                    <td style="width: 150px">{{record.lotNo}}</td>
                    <td style="width: 150px">{{record.stageSignDesc}}</td>
                    <td style="width: 150px">{{record.techniqueAuthor}}</td>
                    <td style="width: 150px">{{record.creationTime | momentFormat:'YYYY-MM-DD HH:mm:ss'}}</td>
                    <td style="width: 150px">{{record.propertyDesc}}</td>
                  </tr>
                </ng-template>
              </p-table>
              <div class="primeng-paging-container">
                <p-paginator [rows]="primengTableHelper.defaultRecordsCountPerPage" #paginator
                  (onPageChange)="getTableList($event)" [totalRecords]="primengTableHelper.totalRecordsCount"
                  [rowsPerPageOptions]="primengTableHelper.predefinedRecordsCountPerPage">
                </p-paginator>
                <span class="total-records-count">
                  {{'TotalRecordsCount' | localize:primengTableHelper.totalRecordsCount}}
                </span>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
    <!-- 搜索弹窗 -->
    <app-search #searchMsg [parentInfo]="rowdata" (modalSave)="getTableList()"></app-search>
    <!-- 详情 -->
    <app-file-manage-detail #fileManageDetail [parentInfo]="rowdata"></app-file-manage-detail>
  </div>